﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CPETwit.Data.Manager;
using CPETwit.Data.Entity;

namespace CPETwit.Web.Business
{
    public class MessageBusiness
    {
        readonly MessageManager _messageManager = new MessageManager();

        public Message SaveMessage(string message)
        {
            Message objetMessage = new Message();
            objetMessage.contenu = message;
            _messageManager.CreateMessage(objetMessage);
            return objetMessage;
        }

        public void SaveTag(Message m, List<Tag> tags)
        {
            foreach (var item in tags)
            {
                _messageManager.CreateLinkTagMessage(m, item);
            }
        }

    }
}
